package com.tx.responder.service;

import com.codingapi.txlcn.tc.annotation.DTXPropagation;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.codingapi.txlcn.tc.annotation.TxcTransaction;
import com.tx.responder.entity.TxResponderEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

@Service
public class ResponderService {




    @Autowired
    TxResponderService txResponderServic;

    @Transactional
//    @LcnTransaction
    @TxcTransaction(propagation = DTXPropagation.SUPPORTS)//分布式事务注解
    public String rpc(String value)   {
        txResponderServic.insert(TxResponderEntity.builder().id(UUID.randomUUID().toString()).testData("okoo").build());
          int v = 100/0;
        return "ok-B"+value;
    }
}
